package builder;

import java.util.Vector;

import model.Action;

/**
 * 
 * @author ELTIO
 */
public class CompositeBuilder extends AbstractPatternBuilder {

	private String client = "Client";
	private String composite = "Composite";
	private String component = "Component";
	private String leaf = "Leaf";
	
	public CompositeBuilder() {
		super();
	}
	
	public Vector<Action> buildPattern () {
		
		this.buildClass(client);
		this.buildClass(leaf);
		this.buildClass(composite);
		
		this.buildAbstractClass(component);
		
		this.buildGeneralization(leaf,component);
		this.buildGeneralization(composite,component);
		
		this.buildAssociation(client,component);
		
		this.buildAggregation(component,composite);
		
		return patternActions;
		
	}

	@Override
	public void changeNames() {
		
		client = names.get(0);
		composite = names.get(1);
		component = names.get(2);
		leaf = names.get(3);
	
	}
	
	@Override
	public int cantUMLElements() {
		return 4;
	}

}
